package a.f.l;

import a.c.z;
import a.d.w;
import a.i.l;

import java.util.*;

public class v
{
  private byte a;
  private Map c = new HashMap(11);
  private List e = new ArrayList(62);
  private double f;
  private double g;
  private double h;
  private int i;
  private Map j = new HashMap();
  private List k = new ArrayList();
  private Map l = new HashMap();
  private Set m = new HashSet();
  private boolean n = true;
  private double o = 0.5D;
  public static final byte p = 0;
  public static final byte q = 1;
  public static int r;
  
  public v(double paramDouble1, double paramDouble2, byte paramByte)
  {
    a(paramDouble1, paramDouble2, paramByte);
  }
  
  public v(double paramDouble1, double paramDouble2)
  {
    this(paramDouble1, paramDouble2, (byte)1);
  }
  
  public void a(double paramDouble1, double paramDouble2, byte paramByte)
  {
    this.m.clear();
    this.l.clear();
    this.k.clear();
    this.j.clear();
    this.f = Math.min(paramDouble1, paramDouble2);
    this.h = Math.max(paramDouble1, paramDouble2);
    this.g = ((paramDouble1 + paramDouble2) / 2.0D);
    this.a = paramByte;
    this.c.clear();
    this.e.clear();
    this.i = -1;
  }
  
  public void a(Object paramObject, w paramw1, w paramw2)
  {
    int i1 = g.Cc;
    if (i1 == 0) {
      if (this.a == 0)
      {
        paramw1 = w.b(paramw1);
        paramw2 = w.b(paramw2);
      }
    }
    b_ localb_;
    if (paramw1.a > paramw2.a)
    {
      localb_ = new b_(paramObject, paramw2, paramw1);
      if (i1 != 0) {
        break label109;
      }
      if (g.Bc == 0) {}
    }
    else
    {
      localb_ = new b_(paramObject, paramw1, paramw2);
    }
    this.c.put(paramObject, localb_);
    this.e.add(localb_);
    label109:
    this.m.add(paramObject);
  }
  
  public void a(Object paramObject1, Object paramObject2, w paramw1, w paramw2)
  {
    int i1 = g.Cc;
    if (i1 == 0) {
      if (this.a == 0)
      {
        paramw1 = w.b(paramw1);
        paramw2 = w.b(paramw2);
      }
    }
    z localz = (z)this.j.get(paramObject2);
    if (i1 == 0)
    {
      if (localz == null)
      {
        localz = new z();
        this.j.put(paramObject2, localz);
      }
    }
    else {
      this.k.add(localz);
    }
    if (i1 == 0) {
      if (paramw1.a > paramw2.a)
      {
        localz.add(new b_(paramObject1, paramw2, paramw1));
        if (i1 != 0) {
          return;
        }
        if (g.Bc == 0) {
          break label151;
        }
      }
    }
    localz.add(new b_(paramObject1, paramw1, paramw2));
    label151:
    this.l.put(paramObject1, localz);
  }
  
  public Iterator a()
  {
    return this.m.iterator();
  }
  
  public boolean a(Object paramObject)
  {
    return this.m.contains(paramObject);
  }
  
  public boolean b(Object paramObject)
  {
    Object localObject = this.j.get(paramObject);
    if (localObject != null) {
      if (g.Cc != 0) {}
    }
    return this.c.containsKey(localObject);
  }
  
  public void b()
  {
    int i4 = g.Cc;
    int i3 = g.Bc;
    if (i4 == 0) {
      if (this.j.size() > 0) {
        c();
      }
    }
    b_[] arrayOfb_ = new b_[this.e.size()];
    double d1 = 1.7976931348623157E+308D;
    double d2 = -1.797693134862316E+308D;
    int i1 = this.e.size() - 1;
    if (i1 >= 0) {}
    while (i4 != 0)
    {
      arrayOfb_[i1] = ((b_)this.e.get(i1));
      d2 = Math.max(d2, arrayOfb_[i1].j.a);
      d1 = Math.min(d1, arrayOfb_[i1].i.a);
      i1--;
      if ((i4 == 0) && (i3 != 0)) {
        break label157;
      }
      if (i3 == 0) {
        break;
      }
    }
    l.a(arrayOfb_, new c_(null));
    label157:
    z localz = new z();
    localz.a(new d_(d1, -1.0D));
    localz.b(new d_(d2, -1.0D));
    int i2 = 0;
    do
    {
      while (i3 == 0)
      {
        if (i2 >= arrayOfb_.length) {
          break;
        }
        a(localz, arrayOfb_[i2]);
        i2++;
      }
    } while (i4 != 0);
  }
  
  private void c()
  {
    int i6 = g.Cc;
    int i5 = g.Bc;
    int i1 = this.k.size() - 1;
    label261:
    label329:
    label362:
    do
    {
      if (i1 < 0) {
        break;
      }
      double d1 = 1.7976931348623157E+308D;
      double d2 = -1.797693134862316E+308D;
      double d3 = d1;
      double d4 = d2;
      int i2 = 1;
      int i3 = 1;
      z localz = (z)this.k.get(i1);
      Object localObject1 = localz.f();
      do
      {
        if (localObject1 == null) {
          break label362;
        }
        localObject2 = (b_)((a.c.v)localObject1).c();
        if (i5 != 0) {
          break;
        }
        if (((b_)localObject2).i.b < d3) {
          d3 = ((b_)localObject2).i.b;
        }
        if (i6 == 0) {
          if (((b_)localObject2).j.b < d3) {
            d3 = ((b_)localObject2).j.b;
          }
        }
        if (i6 == 0) {
          if (((b_)localObject2).i.b > d4) {
            d4 = ((b_)localObject2).i.b;
          }
        }
        if (i6 == 0) {
          if (((b_)localObject2).j.b > d4) {
            d4 = ((b_)localObject2).j.b;
          }
        }
        int i4;
        if (i6 == 0) {
          if (((b_)localObject2).i.a < d1)
          {
            d1 = ((b_)localObject2).i.a;
            i4 = ((b_)localObject2).a(this.g);
            if (i6 == 0) {
              if (i4 != 1) {
                if (i6 != 0) {
                  break label261;
                }
              }
            }
            i2 = i4 == 0 ? 1 : 0;
          }
        }
        if (i6 == 0)
        {
          if (((b_)localObject2).j.a > d2)
          {
            d2 = ((b_)localObject2).j.a;
            i4 = ((b_)localObject2).a(this.g);
            if (i6 == 0) {
              if (i4 != 2) {
                if (i6 != 0) {
                  break label329;
                }
              }
            }
            i3 = i4 == 0 ? 1 : 0;
          }
          this.m.add(((b_)localObject2).g);
          localObject1 = ((a.c.v)localObject1).a();
        }
      } while (i5 == 0);
      if (i6 != 0) {
        break;
      }
      localObject1 = new w(d1, i2 != 0 ? d3 : d4);
      Object localObject2 = new w(d2, i3 != 0 ? d3 : d4);
      b_ localb_ = new b_(localz, (w)localObject1, (w)localObject2);
      this.c.put(localz, localb_);
      this.e.add(localb_);
      i1--;
    } while (i5 == 0);
  }
  
  public double c(Object paramObject)
  {
    if (g.Cc == 0) {
      if (this.i == 0) {
        return (this.f + this.h) * 0.5D;
      }
    }
    return this.f + d(paramObject) / this.i * (this.h - this.f);
  }
  
  public int d()
  {
    return this.i + 1;
  }
  
  public int d(Object paramObject)
  {
    return f(paramObject).k;
  }
  
  public int e(Object paramObject)
  {
    return d(this.j.get(paramObject));
  }
  
  private void a(z paramz, b_ paramb_)
  {
    int i3 = g.Cc;
    int i2 = g.Bc;
    if (i3 == 0) {
      if (this.n)
      {
        if (i3 != 0) {
          break label67;
        }
        if (Math.abs(paramb_.i.a - paramb_.j.a) < this.o)
        {
          paramb_.k = 0;
          return;
        }
      }
    }
    label67:
    int i1 = paramb_.a(this.g);
    d_ locald_1 = new d_(paramb_.i.a(), paramb_.i.b(), (i1 == 0) || (i1 == 1));
    d_ locald_2 = new d_(paramb_.j.a(), paramb_.j.b(), (i1 == 2) || (i1 == 0));
    a.c.v localv1 = paramz.f();
    d_ locald_3 = (d_)localv1.c();
    double d1 = locald_3.getY();
    if (locald_1.getX() > locald_3.getX())
    {
      d1 = locald_3.getY();
      localv1 = localv1.a();
      if ((i3 == 0) && (i2 != 0)) {}
    }
    else
    {
      while (i3 != 0)
      {
        locald_3 = (d_)localv1.c();
        if (i2 == 0) {
          break;
        }
      }
    }
    a.c.v localv2 = paramz.a(locald_1, localv1);
    double d2 = d1;
    if (locald_2.getX() >= locald_3.getX())
    {
      d2 = locald_3.getY();
      d1 = Math.max(d2, d1);
      paramz.h(localv1);
      localv1 = localv1.a();
    }
    while (i3 != 0)
    {
      if (i2 != 0) {
        break label319;
      }
      if (localv1 != null)
      {
        locald_3 = (d_)localv1.c();
        if (i2 == 0) {
          break;
        }
      }
    }
    if (localv2.b() != null)
    {
      label319:
      if (i3 != 0) {
        break label420;
      }
      localObject = (d_)localv2.b().c();
      if ((((d_)localObject).getX() + 5.0D > locald_1.getX()) && (((d_)localObject).a != locald_1.a))
      {
        if (i3 != 0) {
          break label420;
        }
        if (localv2.b().b() != null)
        {
          localObject = (d_)localv2.b().b().c();
          d1 = Math.max(d1, ((d_)localObject).getY());
        }
      }
    }
    label420:
    if (i3 == 0)
    {
      if (localv2.a() != null)
      {
        localObject = (d_)localv2.a().c();
        if (i3 != 0) {
          break label512;
        }
        if ((((d_)localObject).getX() - 5.0D < locald_2.getX()) && (((d_)localObject).a != locald_2.a)) {
          d1 = Math.max(d1, ((d_)localObject).getY());
        }
      }
      localv2.a(new d_(paramb_.i.a(), d1 + 1.0D));
    }
    label512:
    Object localObject = paramz.b(new d_(paramb_.j.a(), d2), localv2);
    paramb_.k = ((int)Math.round(d1 + 1.0D));
    this.i = Math.max(this.i, paramb_.k);
  }
  
  private b_ f(Object paramObject)
  {
    int i1 = g.Cc;
    b_ localb_ = (b_)this.c.get(paramObject);
    if (i1 == 0) {
      if (localb_ == null)
      {
        Object localObject = this.l.get(paramObject);
        if ((i1 != 0) || (localObject != null)) {
          return (b_)this.c.get(localObject);
        }
        throw new IllegalArgumentException("No such key registered!");
      }
    }
    return localb_;
  }
  
  public boolean e()
  {
    return this.n;
  }
  
  public void a(boolean paramBoolean)
  {
    this.n = paramBoolean;
  }
  
  public double f()
  {
    return this.o;
  }
  
  public void a(double paramDouble)
  {
    this.o = paramDouble;
  }
  
  static class b_
  {
    static final byte a = 0;
    static final byte b = 1;
    static final byte d = 2;
    static final byte f = 3;
    Object g;
    w i;
    w j;
    int k;
    
    b_(Object paramObject, w paramw1, w paramw2)
    {
      this.g = paramObject;
      this.i = paramw1;
      this.j = paramw2;
    }
    
    byte a(double paramDouble)
    {
      int m = g.Cc;
      if (m == 0) {
        if (this.i.b < paramDouble)
        {
          if (m == 0) {
            if (this.j.b < paramDouble) {
              return 0;
            }
          }
          return 1;
        }
      }
      if (m == 0) {
        if (this.j.b < paramDouble) {
          return 2;
        }
      }
      return 3;
    }
  }
  
  private class c_
    implements Comparator, l.j_
  {
    private c_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      int m = g.Cc;
      v.b_ localb_1 = (v.b_)paramObject1;
      v.b_ localb_2 = (v.b_)paramObject2;
      int i = localb_1.a(v.this.g);
      int j = localb_2.a(v.this.g);
      if (m == 0) {
        if (i != j) {
          return l.a(i, j);
        }
      }
      if (m == 0) {
        switch (i)
        {
        case 0: 
          if (m == 0) {
            if (localb_1.i.a > localb_2.i.a)
            {
              if (m != 0) {
                break label166;
              }
              if (localb_1.j.a < localb_2.j.a) {
                return -1;
              }
            }
          }
          if (m == 0) {
            if (localb_2.i.a > localb_1.i.a)
            {
              if (m != 0) {
                break label216;
              }
              if (localb_2.j.a < localb_1.j.a) {
                return 1;
              }
            }
          }
          if (m == 0) {
            if (localb_1.j.a < localb_2.i.a) {
              return -1;
            }
          }
          if (m == 0) {
            if (localb_2.j.a < localb_1.i.a) {
              return 1;
            }
          }
          break;
        case 1: 
          if (m == 0) {
            if (localb_1.i.a > localb_2.i.a)
            {
              if (m != 0) {
                break label318;
              }
              if (localb_1.j.a > localb_2.j.a) {
                return -1;
              }
            }
          }
          if (m == 0) {
            if (localb_2.i.a > localb_1.i.a)
            {
              if (m != 0) {
                break label368;
              }
              if (localb_2.j.a > localb_1.j.a) {
                return 1;
              }
            }
          }
          if (m == 0) {
            if (localb_1.i.a == localb_2.i.a)
            {
              if (m == 0) {}
              return localb_1.j.a > localb_2.j.a ? -1 : 1;
            }
          }
          if (m == 0) {
            if (localb_1.j.a == localb_2.j.a)
            {
              if (m == 0) {}
              return localb_1.i.a > localb_2.i.a ? -1 : 1;
            }
          }
          if (m == 0) {}
          return localb_1.i.a <= localb_2.i.a ? -1 : 1;
        case 2: 
          if (m == 0) {
            if (localb_1.i.a < localb_2.i.a)
            {
              if (m != 0) {
                break label556;
              }
              if (localb_1.j.a < localb_2.j.a) {
                return -1;
              }
            }
          }
          if (m == 0) {
            if (localb_2.i.a < localb_1.i.a)
            {
              if (m != 0) {
                break label606;
              }
              if (localb_2.j.a < localb_1.j.a) {
                return 1;
              }
            }
          }
          if (m == 0) {
            if (localb_1.i.a == localb_2.i.a)
            {
              if (m == 0) {}
              return localb_1.j.a < localb_2.j.a ? -1 : 1;
            }
          }
          if (m == 0) {
            if (localb_1.j.a == localb_2.j.a)
            {
              if (m == 0) {}
              return localb_1.i.a < localb_2.i.a ? -1 : 1;
            }
          }
          if (m == 0) {}
          return localb_1.i.a >= localb_2.i.a ? -1 : 1;
        case 3: 
          label166:
          label216:
          label368:
          if (m == 0) {
            if (localb_1.i.a < localb_2.i.a)
            {
              if (m != 0) {
                break label794;
              }
              if (localb_1.j.a > localb_2.j.a) {
                return -1;
              }
            }
          }
          label318:
          label606:
          if (m == 0) {
            if (localb_2.i.a < localb_1.i.a)
            {
              if (m != 0) {
                break label844;
              }
              if (localb_2.j.a > localb_1.j.a) {
                return 1;
              }
            }
          }
          label556:
          label844:
          if (m == 0) {
            if (localb_1.j.a < localb_2.i.a) {
              return -1;
            }
          }
          label794:
          if (m == 0) {
            if (localb_2.j.a < localb_1.i.a) {
              return 1;
            }
          }
          break;
        }
      }
      int k = l.a(localb_1.i.a, localb_2.i.a);
      if (m == 0) {
        if (k == 0)
        {
          k = l.a(localb_1.j.a, localb_2.j.a);
          if (m == 0) {
            if (k == 0)
            {
              k = l.a(localb_1.i.a, localb_2.i.a);
              return -k;
            }
          }
          return k;
        }
      }
      return k;
    }
    
    c_(v.0 param0)
    {
      this();
    }
  }
  
  private static class d_
    extends Point2D.Double
  {
    boolean a;
    
    d_(double paramDouble1, double paramDouble2)
    {
      this(paramDouble1, paramDouble2, true);
    }
    
    d_(double paramDouble1, double paramDouble2, boolean paramBoolean)
    {
      super(paramDouble2);
      this.a = paramBoolean;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.v

 * JD-Core Version:    0.7.0.1

 */